#include "s3c2440.h"
#include "lcd43.h"
#include "GUI.h"

void delay(u32 cnt)
{
    while (cnt--);
}

void test(void)
{
    u32 x;
    
    lcd_init();    
    
    lcd_set_pixel(0,0,RED);
    lcd_set_pixel(1,1,WHITE);
    lcd_draw_hline(10, 100, 50, RED);
    lcd_draw_vline(0, LCD_WIDTH - 1, 300, GREEN);
    lcd_draw_rect(0, 0, LCD_WIDTH - 1, LCD_HEIGHT - 1, BLUE);    
    
    for (x = 0; x < 0x1f + 10; x++)
    {
        lcd_set_pixel(x + 10, 150, (x << 16));
        lcd_set_pixel(x + 10, 200, (x << 8));
        lcd_set_pixel(x + 10, 250, (x << 0));
    }
    
    while (1);
}

void test_gui(void)
{    
    GUI_Init();
    
    GUI_DispString("Hello world!");
    
    //GUI_MessageBox("this is a message", "caption", 0);
    
    GUI_DrawCircle(240, 130, 50);
    
    GUI_SetFont(&GUI_Font8x16);
    GUI_DispStringAt("This text is 8 by 16 pixels", 0, 0);
    
    GUI_SetFont(&GUI_Font6x8);
    GUI_DispStringAt("This text is 6 by 8 pixels", 0, 20);
    
    GUI_SetFont(&GUI_Font8x18);
    GUI_DispStringAt("This text is proportional", 0, 40);
        
    while (1);
}

int main(void)
{
    test_gui();

    return 0;
}
